Field of the Invention
This invention is related to register files in processors.
Description of the Related Art
As instruction set architectures have evolved over time, new instructions and data types have been added. Additionally, in some cases, larger sizes of the same data type have been added. Notably, for example, integer data sizes have been increased from 32 bits to 64 bits. The larger integer data size permits native support in the processor for larger integer ranges. While having a larger integer range can be helpful for some applications, many applications do not require the larger integer range. If a larger integer data size is used where a smaller integer data size would suffice, the locations in which the integer is stored (e.g. in data structures in memory) require more space. Fewer of the larger integers fit in a cache block as well. Accordingly, the size of the data operated on by the application may expand unnecessarily and lead to performance decrease due to higher memory latency, on average. On the other hand, the increase in integer data sizes also increases the addressable memory, which can be a positive influence on performance even if the smaller integer data size is sufficient for various integers manipulated by the application.
Because of the above issues, some instruction set architectures still support the 32 it integer data size when operating in 64 bit integer mode. Thus, a given instruction may be defined to use a 32 bit or 64 bit integer as a source operand and to produce a 32 bit or 64 bit integer as a result (destination operand). In the case of a 32 bit result being written to a register, some instruction set architectures define the result as being written to a portion of the 64 bit integer register (e.g. the least significant portion) and defines a result for the remaining portion (e.g. zero). That is, the architected integer registers are 64 bit registers, and 32 bit results are written to one half of the registers. If the result is later stored to memory, a 32 bit write may be used to avoid retaining the remaining portion if it is uninteresting to the code being executed. On the other hand, when 64 bit integers are desired (e.g. for addressing), the registers and execution hardware to handle the 64 bit integers is available. If a significant number of operands/results in typical code are 32 bit integers, the amount of space occupied by the 64 bit register file and effectively not used by the 32 bit integers is effectively wasted space.